global infile "DataMain.dta"
global outfile "$results/Figure A1"


* Create data with alternative functional forms

use "$infile", clear

sum water if water != 0
sum water, d
display sqrt(24.28572/92.28571)

gen logwater01 = log(water+0.1)
gen logwater10 = log(water+10)

gen invwater01 = asinh(water*0.1)
gen invwater = asinh(water)
gen invwater10 = asinh(water*10)

egen watermh = mean(water), by(home)
egen waterm = mean(watermh), by(home)

gen waternorm = water/waterm

save "Temp", replace

drop if week2 >= 34

save "Temp2", replace


* Figure A1

replace water = 500 if water > 500
hist water, ylab(,nolab) ylab(,notick) xti(Use (liters)) ///
ti(A. Absolute use in levels) graphregion(color(white)) 
graph save "TempA", replace
hist logwater10, ylab(,nolab) ylab(,notick) xti(Log(liters+10)) ///
ti(B. Log(use+10)) graphregion(color(white)) 
graph save "TempB", replace
hist logwater, ylab(,nolab) ylab(,notick) xti(Log(liters+1)) ///
ti(C. Log(use+1)) graphregion(color(white)) 
graph save "TempC", replace
hist logwater01, ylab(,nolab) ylab(,notick) xti(Log(liters+0.1)) ///
ti(D. Log(use+0.1)) graphregion(color(white)) 
graph save "TempD", replace

graph combine "TempA" "TempB" "TempC" "TempD", graphregion(color(white)) 

graph save "$outfile", replace
